package com.wc.AlgoOJ_train.train1.c0.A011;

import java.util.Scanner;

/**
 * @Author congege
 * @Description 多项式求和
 * http://43.138.190.70:8888/p/A011
 * @Date Created in 2023/12/24-22:16
 */
public class Main {
    public static void main(String[] args) {
        double[] arr = new double[1000];
        double sign = 1;
        double sum = 0;
        for (int i = 1; i <= 999; i++) {
            sum += sign / i;
            arr[i] = sum;
            sign = -sign;
        }
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        while (n-- > 0) {
            int idx = sc.nextInt();
            System.out.printf("%.2f\n", arr[idx]);
        }
    }
}
